﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HPAGMRestAPIWrapper;

namespace AGMLite.Common
{
    public class AGMRestAPIHelper
    {
        static  public List<AGMField> GetEntityFields(AGMConnection connection, string entitytype)
        {
            List<AGMField> entityFields = new List<AGMField>();

            var fields = new AGMField().GetFields(connection, entitytype, null);

            foreach (AGMField field in fields.Where(o => !string.IsNullOrEmpty(o.Label) && o.Active && o.Visible))
            {
                entityFields.Add(field);
            }

            return entityFields;
        }
    }
}
